{extend name="index_layout"/}
{block name="main"}
<form class="layui-form" method="post">

    <div class="layui-form-item">
        <label class="layui-form-label">日期</label>
        <div class="layui-input-block">
            <input type="text" name="row[date]" id="date1" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">淘宝用户ID</label>
        <div class="layui-input-block">
            <input id="c-tb_id" lay-verify="required" class=" layui-input" name="row[tb_id]" type="text" value="{$data.tb_id}" >
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">订单编号</label>
        <div class="layui-input-block">
            <input id="c-nums" lay-verify="required" class=" layui-input" name="row[order_id]" type="text" value="{$data.order_id}">
        </div>
    </div>


    <div class="layui-form-item layer-footer">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
{/block}
{block name="script"}
<script type="text/javascript">
    layui.use(['yznForm','laydate'], function() {
        var yznForm = layui.yznForm;
        var laydate = layui.laydate;
        laydate.render({
            elem: '#date1'
        });
        yznForm.bindevent($("form.layui-form"));
    });

    $('#c-price').blur(function() {
        var nums =  $('#c-nums').val()
        var price =  $('#c-price').val()
        if(nums && price){
            $('#c-money').val(nums * price)
        }

    });


    $('#c-goods-price').blur(function () {
        var nums =  $('#c-nums').val()
        var price =  Number($('#c-price').val())
        var goods_price =  Number($('#c-goods-price').val())
        if(nums && price && goods_price){
            console.log(price + goods_price)
            $('#c-total-money').val((price + goods_price) * nums)
        }


    })


    $('#c-nums').blur(function() {
        var nums =  $('#c-nums').val()
        var price =  $('#c-price').val()
        if(nums && price){
            $('#c-money').val(nums * price)
        }

    });

</script>
{/block}